<?php
/**
 * 支付接口
 * @author maniac
 */
namespace app\api\controller\v1;

use app\facade\Pay AS PayFacade;
use think\Db;
class Pay extends Base
{
    //请求支付
    public function repay(){
        $data = input('post.');
        $data['userid']  = $this->checkUserToken();
//        $data['userid']  = input('user_id');
        $data['id']     = input('id', 0);
        $data['platform']    = input('platform', 'JSAPI');
        try {
            $result = PayFacade::repay($data);
            if ($result) {
                return j(0, '成功',$result);
            }

            return j(1, '支付失败');
        } catch (\Exception $e) {
            return j(1, $e->getMessage());
        }
    }
}
